package com.xxx.video.login.activitys;

import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.EditText;


import com.xxx.video.R;
import com.xxx.video.commen.activitys.BaseActivity;
import com.xxx.video.commen.utils.FontCacheUtils;
import com.xxx.video.commen.utils.StatusBarUtil;
import com.xxx.video.commen.views.FontTextView;
import com.xxx.video.login.presenters.IInputUserNameView;
import com.xxx.video.login.presenters.InputUserNamePresenter;

import butterknife.BindView;
import butterknife.OnClick;

public class InputUserNameActivity extends BaseActivity<InputUserNamePresenter> implements IInputUserNameView {
    @BindView(R.id.et_input_username_activity_content)
    EditText etInputUsernameActivityContent;

    @Override
    protected InputUserNamePresenter createPresenter() {
        return new InputUserNamePresenter(this, this);
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_input_user_name;
    }

    @Override
    public void initToolbarData() {
        super.initToolbarData();
        showActionBar();
        StatusBarUtil.getInstance().setStatusBarTransparent(this, true);
        setActionBarTitle(R.string.title_input_user_name_activity);
        Typeface customFont = FontCacheUtils.getInstance().getTypeface(FontTextView.ttf3, this);
        etInputUsernameActivityContent.setTypeface(customFont);
    }

    @Override
    public void initData(Bundle extras) {
        showRootLayoutStatus(1);
    }

    @Override
    public void showRootLayoutStatus(int status) {
        showLayoutStatus(status);
    }

    @Override
    public String getUserName() {
        return etInputUsernameActivityContent.getText().toString().trim();
    }

    @Override
    public void startForgetPwdActivity() {
        Bundle bundle = new Bundle();
        bundle.putString("userName", getUserName());
        intent2Activity(ForgetPwdFirstActivity.class, bundle);
        finish();
    }

    @OnClick(R.id.tv_input_username_activity_next)
    public void onViewClicked() {
        getPresenter().startForgetPwdActivity();
    }
}
